package cn.com.zhbs.login.service.impl;

import cn.com.zhbs.account.entitys.Account;
import cn.com.zhbs.common.util.Encrypt;
import cn.com.zhbs.login.dao.ForgetPasswordMapper;
import cn.com.zhbs.login.service.ForgetPasswordService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @program: vr_manage
 * @description: 忘记密码实现层
 * @author: 陈治杰
 * @create: 2021-08-09 11:10
 **/
@Service
public class ForgetPasswordServiceImpl implements ForgetPasswordService {
    @Resource
    ForgetPasswordMapper forgetPasswordMapper;

    @Override
    public void editPassword(JSONObject jsonObject) {
        String password = Encrypt.encrypt(jsonObject.get(Account.account.toString()).toString()+jsonObject.get(Account.password.toString()).toString());
        jsonObject.put(Account.password.toString(),password);
        forgetPasswordMapper.updatePasswordByAccount(jsonObject);
    }
}
